<?
/*
 * TODO: article fckeditor on the fly
 * to remove the border: go toedit #xEditingArea -> border:none
 * in http://hvn/public/library/fckeditor/editor/skins/famfamfamAluminum/fck_editor.css
 * 
 */
?>
<? $languages =  Zend_Registry::get('configuration')->languagename;?>
<div style="text-align:right">
<? foreach ($languages as $k=>$v) :?>
    <?// if ($k != $this->article->language) :?> 
		<a href="/<?=$k ?>/article/view?id=<? print $this->article->article_id ?>"><?=$v?></a>
	<?//endif?>
<?endforeach?>
| <a href="<?=$this->hvnUrl(array('module' => 'article', 'action' => 'edit'))?>?id=<?=$this->article->article_id?>"> <?=t(91) ?> </a>
</div>
<?if (!empty($this->errorMessage)) :?>
<span style='color:red;font-size:11px'> <?=$this->errorMessage; ?> 
<?=t(92) ?> <a href="<?=$this->hvnUrl(array('module' => 'article', 'action' => 'translate'))?>?id=<?=$this->article->article_id?>&to=<?=Zend_Registry::get('viewLang')?>"> <?=t(95) ?> </a>
</span>
<?endif ?>
<div style="padding:10px">
<h3>#<?= $this->article->article_id;?> <?= $this->article->article_title;?></h3>

<script type="text/javascript" src="/public/library/jquery/autoresize.jquery.js"></script>
<script type="text/javascript">
$('textarea#article-body-textarea').autoResize({
    // On resize:
    onResize : function() {
        $(this).css({opacity:0.8});
    },
    // After resize:
    animateCallback : function() {
        $(this).css({opacity:1});
    },
    // Quite slow animation:
    animateDuration : 300,
    // More extra space:
    extraSpace : 20
});

$(function() {
    $("#edit-body").click(function(e){
        $("#article-body-textarea").toggle().val($("#article-body").toggle().html());
        
        $('textarea#article-body-textarea').autoResize();
//        $("#article-body-textarea").val('abc');
        return false;                
    })
});

</script>

<a id="edit-body" href="javascript:void();"> edit body </a> 
<br/>
<span id="article-body">
<?=$this->article->article_filtered_body;?>
</span>
<textarea id="article-body-textarea" style="width:100%;height:100%;display:none">asdf</textarea>
</div>


<h3 style="color:green; text-decoration:underline"> <?=t(512) ?> </h3>
<br> <?=t(14) ?>    : 
<?=$this->article->article_module?>
<br><?=t(93) ?>   : <?= Zend_Registry::get('configuration')->languagename->{$this->article->article_language}; ?>
<br><?=t(2) ?>    : <?=$this->article->article_status; ?>
<br><?=t(15) ?>   : <?=$this->article->article_keywords; ?>
<br><?=t(83) ?>   : <?=$this->article->article_poster_id; ?>
<br><?=t(84) ?>   : <?=$this->article->article_post_time; ?>
<p>


<hr/>
<p>
<?=t(94) ?><a href="<?=$this->hvnUrl(array('module' => 'article', 'action' => 'search'))?>"> <?=t(9) ?> </a>
</p>
